/*
 * Copyright (c) 2010-2011 NutShell.
 * [Id:SkinBean.java  11-7-10 下午8:41 poplar.mumu ]
 */
package org.mumu.pawn.beans.common;

import org.mumu.pawn.util.FacesUtil;

import javax.annotation.PostConstruct;
import javax.enterprise.context.SessionScoped;
import javax.inject.Named;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 合肥.
 * <br/>
 *
 * @author poplar_mumu
 * @version 1.0 11-7-10 下午8:41
 * @since JDK 1.0
 */
@Named( "skinBean")
@SessionScoped
public class SkinBean implements Serializable {
    private static final long serialVersionUID = -5516936602454580608L;

    private static final String SKIN_VIEW_PARAMETER = "skin";

    private String skin ="mumu";
    private List<String> skins;

    @PostConstruct
    public void initialize() {
        skins = new ArrayList<String>();
        skins.add("blueSky");
        skins.add("classic");
        skins.add("deepMarine");
        skins.add("emeraldTown");
        skins.add("japanCherry");
        skins.add("ruby");
        skins.add("wine");
    }


    public String getSkin() {
        String currentSkin = FacesUtil.getViewParameter(SKIN_VIEW_PARAMETER);
        if (currentSkin != null) {
            skin = currentSkin;
        }
        return skin;
    }

    public void setSkin(String skin) {
        this.skin = skin;
    }

    public List<String> getSkins() {
        return skins;
    }
}
